Skip to content

Conversation

jordanSu
Copy link
Contributor

Description

As mentioned in #200, this PR makes cz check can read message from pipe. In this mode, "--message" option is used.

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

String input from pipe can be read by cz check

Steps to Test This Pull Request

  1. echo COMMIT_MESSAGE | cz check
  2. cat COMMIT_FILE | cz check

Additional context

#200

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #267 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #267      +/-   ##
==========================================
+ Coverage   96.60%   96.62%   +0.02%     
==========================================
  Files          33       33              
  Lines         912      919       +7     
==========================================
+ Hits          881      888       +7     
  Misses         31       31              
Flag Coverage Δ
#unittests 96.62% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
commitizen/cli.py 97.36% <ø> (ø)
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/check.py 100.00% <100.00%> (ø)
...en/cz/conventional_commits/conventional_commits.py 98.41% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b207e6d...f679618. Read the comment docs.

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks great 🙂 I've also tested it on my local machine. But this feature is not obvious enough for users to find it. Could you please add some example to the documentation? Thanks!

if not (
bool(self.commit_msg_file) ^ bool(self.commit_msg) ^ bool(self.rev_range)
):
sources = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming sources does not look straightforward to me. Currently, I do not have a better name for it. But we could at least add some comments to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the amount/number of params provided, so something like params_amount or number_params_provided could be

@woile
Copy link
Member

woile commented Sep 16, 2020

Nice work! Looks great, I'm not much an user of check so Lee can decide when to merge this. But I have to say, this PR would be super cool and I'd start using something like echo "fix: bfoo bar" | cz check.
Docs would be highly appreciated.

@Lee-W
Copy link
Member

Lee-W commented Sep 18, 2020

As #255 is merged, we can close this one

@Lee-W Lee-W closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants